package db

//引入框架

import (
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"xorm.io/xorm"
)

var DB *xorm.Engine

func init() {
	driverName := "mysql"
	dataSource := "root:root@tcp(localhost)/love?charset=utf8"
	engine, err := xorm.NewEngine(driverName, dataSource)
	if err != nil {
		fmt.Println("数据库连接失败!")
	}
	DB = engine
}
